package ca.usask.cs.exceptions;

import ca.usask.cs.decisiontree.api.Edge;
import ca.usask.cs.decisiontree.api.Node;

public class Exceptions extends Exception{
	
	public void nullNodeCheck(Node node, String msg) throws IllegalArgumentException{
		 if(node == null){
			 throw new IllegalArgumentException(msg);
		 }
	}
	
	
	public void rootNodeHasSourceEdgeCheck(Node node, String msg){
		 if(node.getSourceEdge() != null){
			 throw new IllegalArgumentException(msg);
		 }
	}
	
	public void nodeEqualCheck(Node node1, Node node2, String msg){
		 if(node1 == node2){
			 throw new IllegalArgumentException(msg);
		 }
	}
	
	public void nullEdgeCheck(Edge edge, String msg){
		 if(edge == null){
			 throw new IllegalArgumentException(msg);
		 }
	}
	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

}
